# -*- coding: UTF-8 -*-
"""
@Time : 2022/12/5
@Author : Gloria
"""
from django.contrib import admin
from django.utils.safestring import mark_safe
from app01.models import Navs

# 网站导航
class NavsAdmin(admin.ModelAdmin):
    def get_icon_href(self: Navs):
        if self.icon_href:
            return mark_safe(f"""<img src="{self.icon_href}" style="height:30px; border-radius:5px">""")

    get_icon_href.short_description = '标签图标'

    list_display = ['title', 'status', get_icon_href]